package com.mindtree.vi.business.user;

import org.springframework.transaction.annotation.Transactional;

import com.mindtree.vi.business.javaservice.UserUtil;
import com.mindtree.vi.dbaccess.datatypes.user.User;
import com.mindtree.vi.dbaccess.manager.TableManager;

/**
 * @author venkatesh
 * 
 */
@Transactional
public class SimpleUserManager implements UserManager {

	private TableManager<User> tableManager;

	public void setTableManager(TableManager<User> tableManager) {
		this.tableManager = tableManager;
	}

	public User registerUser(User user) {
		user = tableManager.save(user);
		UserUtil.setUser(user);
		return user;
	}
}
